package com.qk.filter;


import jakarta.servlet.*;

import java.io.IOException;
//@WebFilter(urlPatterns = "/*")// 过滤器一定要写路径注解
public  class FilterDemo implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("...........................init.......");
    }

    @Override
    public void destroy() {
        Filter.super.destroy();
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("doFilter.......");
        filterChain.doFilter(servletRequest,servletResponse);
    }
}
